package com.xxxx.seckill.test.rabbitMq.controller;

import com.xxxx.seckill.test.rabbitMq.method.SendMethod;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import static com.xxxx.seckill.test.rabbitMq.conf.MqNames.NORMAL_QUEUE;

@RestController
@ResponseBody
@RequestMapping("/test")
public class RabbitMqController {
    @Autowired
    private SendMethod sendMethod;

    @GetMapping("/mq01")
    public void mq01(){
        sendMethod.send01("NORMAL QUEUE IS COMING 。。。");
    }

    @GetMapping("/mq02")
    public void mq02() throws InterruptedException {
        sendMethod.send02("NORMAL QUEUE IS COMING 。。。");
    }

    @GetMapping("/mq03")
    public void mq03()  {
        sendMethod.send03("FANOUTR QUEUE IS COMING 。。。");
    }

    @GetMapping("/mq03/{color}")
    public void mq03(@PathVariable String color)  {
        sendMethod.send04(color);
    }

    @GetMapping("/mq04/{color}")
    public void mq04(@PathVariable String color)  {
        sendMethod.send05(color);
    }
}
